<?php	
	$url = $_SERVER['REQUEST_URI'];
	$params = explode('/', $url);
	$languagesString = Zend_Registry::get('config')->languages;
	$languages = explode('/', $languagesString);
	$retUrl = "/";
	$lang = "";
	
	if (in_array($params[1], $languages))
	{
		$lang = $params[1] . "/";	
		for ($i = 2; $i < count($params); ++$i){
			if ($params[$i] != ""){
				$retUrl = $retUrl . $params[$i] . "/";
			}
		}
	}
	else
	{
		for ($i = 1; $i < count($params); ++$i)
		{
			if ($params[$i] != ""){
				$retUrl = $retUrl . $params[$i] . "/";
			}
		}
	}
?>

<div id="statisticsMenu">
	<h3>Mer statistik</h3>
	<ul>
		<?php
			$statisticsLinks = Zend_Registry::get('config')->statisticsLink->toArray();
			
			//for($i=0; $i<count($statisticsLinks); ++$i)
			{
				while($url = current($statisticsLinks))
				{
					$menuItemText = key($statisticsLinks);
					?>				
					<li>
						<a href="http://<?php echo $_SERVER['SERVER_NAME'] . "/" . $lang .  $url ?>"><?php echo(Zend_Registry::get('translate')->_($menuItemText)); ?></a>												
					</li>
					<?php
					
					next($statisticsLinks);
				}
			}			
		?>

	</ul>
	
	<div class="info smallInfo">
		<?php echo(Zend_Registry::get('translate')->_('GRAVATAR_INFO')); ?>
		<div><a href="http://www.gravatar.com">http://www.gravatar.com</a></div>
	</div>
</div>